package ch.fusun.baron.player;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.core.rmi.User;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.player.api.PlayerService;

/**
 * 
 */
public class SetDynastyForUserDataUpdate implements DataUpdate {

	private Dynasty dynasty;
	private User user;
	@Inject
	private transient PlayerService playerService;

	/**
	 * Kryo
	 */
	public SetDynastyForUserDataUpdate() {
	}

	/**
	 * @param dynasty
	 *            The dynasty
	 * @param user
	 *            The user
	 */
	public SetDynastyForUserDataUpdate(Dynasty dynasty, User user) {
		this.dynasty = dynasty;
		this.user = user;
	}

	@Override
	public void update() {
		playerService.setDynastyForUser(dynasty, user);
	}

}
